<template>
    <div id="ask_container">
        <input type="text" placeholder="请输入手机号或订单号" v-model="no">
        <div class="big-btn" @click="find">升级会员</div>
    </div>
</template>
<script>
import { Indicator, Toast } from 'mint-ui'
export default {
  name: 'askMembership',
  data() {
      return {
          no: ''
      }
  },
  methods: {
      async find() {
          Indicator.open()
          const { success, msg } = await this.$store.dispatch('member/askMembership', this.no)
          Indicator.close()
          if(success) {
              Toast({
                message: '恭喜！您已升级成功！',
                position: 'middle',
                duration: 800
                })
              setTimeout(() => this.$router.replace('/usercenter'), 1000)
          }
          else Toast(msg)
      }
  }
}
</script>
<style lang="less" scoped>
#ask_container{
    text-align: center;
    margin-top: 3rem;
    input{
        font-size: .35rem;
        border-radius: .2rem;
        padding: .3rem .4rem;
        width: 8rem;
        margin: 1rem;
    }
    .big-btn{
        margin: 0 auto;
        width: 8rem;
    }
}
</style>

